Skip to content

Refuse unserializing the coordinator from __unserialize() - #156

Merged
PDowney merged 3 commits into
mainfrom
fix-wakeup-unserialize
Nov 24, 2026
Merged

PDowney merged 3 commits into
mainfrom
fix-wakeup-unserialize

Conversation

@PDowney

@PDowney PDowney commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

PHP 8.5 deprecates __wakeup(), and Psalm 7.16 reports declaring it as DeprecatedSyntax, which has failed the Psalm job on every pull request since the 7.16 release.

  • Optimizations_Ace_Mc::__wakeup() becomes __unserialize( array $data ). PHP calls it for every unserialize() of the class, so the singleton is still refused with the same escaped LogicException.
  • The two tests call __unserialize() where they called __wakeup().
  • The translation template's source reference moved with the string (composer make-pot).
  • composer.json requires ext-filter, which Psalm 7.17.0 (MissingExtensionRequirement) asks for because the settings class calls filter_var(); composer.lock has the refreshed content hash only.

Checks run locally: composer check-all (PHPCS, PHPMD, Psalm and taint, PHPStan, Rector, PHPUnit), Plugin Check rules, and PHPCompatibilityWP 8.3+.

🤖 Generated with Claude Code

PHP 8.5 deprecates __wakeup(), and Psalm 7.16 reports declaring it
as DeprecatedSyntax. PHP calls __unserialize() for every unserialize()
of the class, so the singleton is still refused with the same escaped
LogicException. One test now goes through a real unserialize() call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for contributing to Optimizations ACE MC!

Before we review:

  • Have you tested your changes with WordPress 7.0+?
  • Are your changes compatible with PHP 8.3+?
  • Have you followed WordPress coding standards?
  • Did you update the CHANGELOG.md if needed?

Security Reminder
This plugin changes WooCommerce, WP Store Locator, and WordPress admin screens, so please ensure:

  • All user input is properly sanitized
  • All output is properly escaped
  • No security vulnerabilities are introduced

We'll review your PR soon.

@github-actions github-actions Bot added documentation Improvements or additions to documentation security testing core i18n labels Nov 24, 2026
@codacy-production

codacy-production Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

PDowney and others added 2 commits November 24, 2026 01:43
Codacy's Semgrep rule flags any unserialize() call, test code included.
The test calls the magic method the way it called __wakeup() before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Psalm 7.17 reports MissingExtensionRequirement for filter_var() when
composer.json does not require ext-filter. The code needs the
extension, so composer.json now requires it; the lock hash is refreshed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PDowney
PDowney merged commit 7f79abd into main Nov 24, 2026
27 checks passed
@PDowney
PDowney deleted the fix-wakeup-unserialize branch November 24, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core documentation Improvements or additions to documentation i18n security testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant